﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T4ViewModel.Test
{
    public class PersonModel
    {
        public int Id { get; set; }
        [Required(ErrorMessageResourceType = typeof(Resource), ErrorMessageResourceName="TestErrorMessage")]
        public string FirstName { get; set; }
        [Required]
        public string LastName { get; set; }
        public ICollection<BlogPostModel> Posts { get; set; }
    }

    public class BlogPostModel
    {
        public int Id { get; set; }
        [Required]
        [MaxLength(250)]
        public string Title { get; set; }
        [Required]
        public string Body { get; set; }
        [Required]
        public PersonModel Author { get; set; }
        public ICollection<CommentModel> Comments { get; set; }
    }

    public class CommentModel
    {
        public int Id { get; set; }
        [Required]
        public string Contents { get; set; }
        [Required]
        public PersonModel Author { get; set; }
        [Required]
        [Range(0, int.MaxValue)]
        public int Likes { get; set; }
    }
}
